
package net.atremmedia.gwt.actionjava.examples.tween.samples;

import net.atremmedia.gwt.actionjava.examples.AJExample;
import net.atremmedia.gwt.actionjava.examples.frame.AJExampleOverview;
import actionjava.anim.Anim;
import actionjava.anim.config.Manifest;
import actionjava.display.Graphics;
import actionjava.display.Shape;
import actionjava.geom.Color;

public class TweenExample1 extends AJExample
{
	public static final String NAME = "TweenExample 1";
	public static final String DESCRIPTION = "Description";
	public static final String EXAMPLE_SRC = "https://code.google.com/p/gwt-actionjava/source/browse/trunk/aj-examples/aj-examples-tween/src/main/java/net/atremmedia/gwt/actionjava/examples/tween/samples/TweenExample1.java";

	private Shape testFigure;

	public TweenExample1(AJExampleOverview base)
	{
		super(NAME, DESCRIPTION, EXAMPLE_SRC, base);
	}

	@Override
	public void run()
	{
		testFigure = new Shape();
		Graphics graphs = testFigure.getGraphics();
		graphs.beginFill(Color.getRGB(0xFF0000));
		graphs.drawCircle(50, 50, 50);
		graphs.endFill();

		addChild(testFigure);

		Anim.tween(new Manifest(testFigure, 3)
		{
			@Override
			protected void configure()
			{
				to(X, 650);
				to(Y, 450);
			}
		});
	}

}
